import 'package:flutter/material.dart';

class ButtonItem extends StatelessWidget {
  Function onPressed;
  var content;
  static const defalutContent = Text('我是按钮');
  // ignore: top_level_function_literal_block
  static defalutFuntion() {}

  int type;

  ButtonItem(
      {this.onPressed: defalutFuntion,
      this.content: defalutContent,
      this.type: 0});

  @override
  Widget build(BuildContext context) {
    if (type == 0) {
      return RaisedButton(
        onPressed: onPressed,
        child: this.content,
        color: Colors.blue,
        textColor: Colors.white,
      );
    }
    if (type == 1) {
      return FlatButton(
        onPressed: onPressed,
        child: this.content,
        // color: Colors.blue,
        // textColor: Colors.white,
      );
    }
  }
}
